<style>
	#ui-datepicker-div.ui-widget-content{background: #fff;border: 1px solid gray;}
	table{text-align: left;width: 100%;}
	table tr th{background-color: #eeeeee;}
	table tr td,table tr th{border: 1px solid #d3d2d2;padding: 10px;}
	table input{width: 80px;height: 20px;}
	
	table label{display: inline-block;cursor: default;margin: 0 3px;}
	table input[type="checkbox"],table input[type="radio"]{margin: 0;cursor: default;margin-top: -2px;}
	table .thSetPrice a{
		display: block;margin: 5px 0;padding: 3px 5px;border: 1px solid #888888;background-color: #888888;
		color: #fff;text-decoration: none;text-align: center;width: 60px;cursor: pointer;
	}
	table a:hover{text-decoration: none;background-color: #368ee0;border-color: #368ee0;}
	
	.page{padding: 5px;border: 2px solid #368ee0;border-top: none;}
	.page .page_count{padding-top: 5px;}
	.page .page_count label{display: inline-block;line-height: 30px;font-weight: normal;float: left;}
	.page .page_count .paginate_button{
		margin: 0 5px;
		float: left;
		background-color: #D5D5D5;
		padding: 5px 12px;
		color: #7d7d7d;
		border-radius: 3px;
	}
	.page .page_count .paginate_button:hover{
		background-color: #89affc;
		color: #fff;
	}
	.page .page_count .paginate_active{
		margin: 0 5px;
		float: left;
		padding: 5px 12px;
		color: #fff;
		background-color: #89affc;
		border-radius: 3px;
	}
	.page a{text-decoration: none;}
	.page b{color: #FF4500;}
	
	.box-title a{float: right;border: 1px solid #5bc0de;background: #5bc0de;color: #fff;padding: 3px 8px;border-radius: 3px;margin-right: 10px;}
	table a{border: 1px solid #5bc0de;background: #5bc0de;color: #fff;padding: 5px 8px;border-radius: 3px;}
	table a:hover{color: #fff;}
	table tbody tr:hover{background-color: #D9D9D9;}
</style>
<div id="main">
    <div class="container-fluid">
        <div class="page-header">
        	<div class="pull-left">
        		<h1>房价_房态：推送</h1>
        	</div>
        	<div class="pull-right">
        		<ul class="stats">
        			<li class='lightred'>
        				<i class="icon-calendar"></i>
        				<div class="details">
        					<span class="big"></span>
        					<span></span>
        				</div>
        			</li>
        		</ul>
        	</div>
        </div>
        <div class="breadcrumbs">
        	<ul>
        		<li>
        			<a href="javascript:void(0);">后台管理</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">房价_房态：推送</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">房价_房态：推送</a>
        		</li>
        	</ul>
        	<div class="close-bread">
        		<a href="#"><i class="icon-remove"></i></a>
        	</div>
        </div>
        <div class="row-fluid">
        	<div class="span12">
        		<div class="box box-color box-bordered">
        			<div class="box-title">
        				<h3>
        					<i class="icon-th-list"></i>
        					房价_房态：推送
        				</h3>
                        <a href="javascript:void(0);" class="show_shadefrist" onclick="hotelTO(0,0,0,2)" style="color: #EAEA00;">全部房态推送</a>
                        <a href="javascript:void(0);" class="show_shadefrist" onclick="hotelTO(0,0,0,1)">全部房价推送</a>
        			</div>
                    <div style="border: 2px solid #368ee0;border-top: none;border-bottom: none;padding: 10px;">
                        <form action="" method="get" style="margin: 0;padding: 0;">
                            关键字 <input type="text" name="nameKey" value="<?=$nameKey?>" placeholder="酒店名称,房型名称(多个用半角逗号分开)" style="margin-top: 5px;width: 250px;" />
                            &nbsp;&nbsp;&nbsp;<button style="border: 1px solid transparent;background-color: #368ee0;color: #fff;padding: 3px 8px;margin-top: -5px;">查询</button>
                            <a href="<?=$this->url('mySetPrice/hotelPrice')?>" style="color: red;margin-left: 10px;">显示全部</a>
                        </form>
                    </div>
                    <div style="border: 2px solid #368ee0;border-top: none;<?=$number>1?'border-bottom: none;':''?>">
                        <table>
        					<thead>
        						<tr>
        							<th>序号</th>
        							<th>酒店名称</th>
        							<th>房型名称</th>
        							<th>操作</th>
        						</tr>
        					</thead>
                            <tbody>
                                <?
                                if($re){
                                    foreach($re as $k=>$v){?>
                                        <tr>
                                            <td><?=$page==1?$page*($k+1):$size*$page-$size+$k+1?></td>
                							<td><?=$v['hotelName']?></td>
                							<td><?=$v['title']?></td>
                							<td>
                                                <a href="javascript:void(0);" class="show_shadefrist" onclick="hotelTO('<?=$v["categoryid"]?>','<?=$v['parentTypeId']?>','<?=$v["id"]?>',1)">推送房价</a>
                                                <a href="javascript:void(0);" class="show_shadefrist" style="color: #EAEA00;" onclick="hotelTO('<?=$v["categoryid"]?>','<?=$v['parentTypeId']?>','<?=$v["id"]?>',2)">推送房态</a>
                                            </td>
                						</tr>
                                    <?}
                                }else{?>
                                    <tr><td colspan="4" style="text-align: center;font-size: 20px;">没有相关记录</td></tr>
                                <?}?>
                            </tbody>
        				</table>
                    </div>
                    <?if($re&&$number>1){?><div class="page"><?=$pageHtml?></div><?}?>
                </div>
        	</div>
        </div>
    </div>
</div>
<script>
function hotelTO(hotelId,parentTypeId,typeid,orther){
    var url="";
    if(orther==1){
        url="<?=$this->url('mySetPrice/hotelPriceTO')?>";
    }else{
        url="<?=$this->url('mySetPrice/hotelStatusTO')?>";
    }
    $.ajax({
        type:'post',
        url:url,
        data:"hotelId="+hotelId+"&parentTypeId="+parentTypeId+"&typeid="+typeid,
        dataType:'json',
        success:function (r){
            if(r.state==1){
                pub_alert_success(r.html,2000);
            }else if(r.state==0){
                pub_alert_error(r.html,2000);
            }
        },error:function(){
            pub_alert_error("ajax错误！",2000);
        }
    });
}
</script>